# -*- coding: utf-8 -*-
class SysMsg < ActiveRecord::Base
  belongs_to :editor, :class_name => 'Employee', :foreign_key => 'employee_id'
  scope :employee_like, lambda { |companyId,employeeId| { :conditions => ['company_id = ? AND employee_id = ?', companyId,employeeId] }}

  scope :unread, where(:is_new => '未读')
  
  scope :paginate, lambda { |start,limit| { :offset => start.to_i,:limit => limit.to_i,:order=>"id DESC" }}
end
